package com.itheima.mp.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum UserStatus {
    NORMAL(1,"正常"),
    FROZEN(2,"冻结"),
    ;
    @EnumValue  //让m-plus知道把这个往数据库里面写(因为数据库是int类型)
    private final int value; //对应数据库的值
    @JsonValue  //返回给客服端的
    private final String desc; //方便程序员理解

    UserStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }
}
